.class Lcom/burstly/lib/component/networkcomponent/burstly/video/VideoTracker$1;
.super Ljava/lang/Object;
.source "VideoTracker.java"

# interfaces
.implements Ljava/lang/Runnable;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/burstly/lib/component/networkcomponent/burstly/video/VideoTracker;->createTrackerRunnable()Ljava/lang/Runnable;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$0:Lcom/burstly/lib/component/networkcomponent/burstly/video/VideoTracker;


# direct methods
.method constructor <init>(Lcom/burstly/lib/component/networkcomponent/burstly/video/VideoTracker;)V
    .locals 0
    .parameter

    .prologue
    .line 95
    iput-object p1, p0, Lcom/burstly/lib/component/networkcomponent/burstly/video/VideoTracker$1;->this$0:Lcom/burstly/lib/component/networkcomponent/burstly/video/VideoTracker;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method private getVideoDuration()I
    .locals 3

    .prologue
    .line 141
    const/4 v1, -0x1

    .line 142
    .local v1, total:I
    const/4 v0, 0x0

    .local v0, i:I
    :goto_0
    const/4 v2, 0x3

    if-ge v0, v2, :cond_0

    .line 143
    const/16 v2, 0x12c

    invoke-static {v2}, Lcom/burstly/lib/component/networkcomponent/burstly/video/VideoTracker;->sleep(I)V

    .line 144
    iget-object v2, p0, Lcom/burstly/lib/component/networkcomponent/burstly/video/VideoTracker$1;->this$0:Lcom/burstly/lib/component/networkcomponent/burstly/video/VideoTracker;

    iget-object v2, v2, Lcom/burstly/lib/component/networkcomponent/burstly/video/VideoTracker;->mPlayer:Landroid/widget/VideoView;

    invoke-virtual {v2}, Landroid/widget/VideoView;->getDuration()I

    move-result v1

    .line 145
    if-lez v1, :cond_1

    .line 149
    :cond_0
    return v1

    .line 142
    :cond_1
    add-int/lit8 v0, v0, 0x1

    goto :goto_0
.end method

.method private sendRequest([Ljava/lang/String;Ljava/lang/String;)V
    .locals 4
    .parameter "urls"
    .parameter "tag"

    .prologue
    .line 130
    move-object v0, p1

    .local v0, arr$:[Ljava/lang/String;
    array-length v2, v0

    .local v2, len$:I
    const/4 v1, 0x0

    .local v1, i$:I
    :goto_0
    if-ge v1, v2, :cond_0

    aget-object v3, v0, v1

    .line 131
    .local v3, url:Ljava/lang/String;
    invoke-static {v3, p2}, Lcom/burstly/lib/network/request/RequestManager;->makeTrackEventRequest(Ljava/lang/String;Ljava/lang/String;)Lcom/burstly/lib/network/request/AbortableAsyncTask;

    .line 130
    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    .line 133
    .end local v3           #url:Ljava/lang/String;
    :cond_0
    return-void
.end method


# virtual methods
.method public run()V
    .locals 10

    .prologue
    .line 100
    :try_start_0
    invoke-static {}, Lcom/burstly/lib/util/Utils;->lowerCurrentThreadPriority()V

    .line 101
    const/4 v0, 0x0

    .line 102
    .local v0, currentPosition:I
    invoke-direct {p0}, Lcom/burstly/lib/component/networkcomponent/burstly/video/VideoTracker$1;->getVideoDuration()I

    move-result v3

    .line 103
    .local v3, total:I
    invoke-static {}, Lcom/burstly/lib/component/networkcomponent/burstly/video/VideoTracker;->access$000()Lcom/burstly/lib/util/LoggerExt;

    move-result-object v4

    const-string v5, "VideoTracker"

    const-string v6, "Video duration: {0}"

    const/4 v7, 0x1

    new-array v7, v7, [Ljava/lang/Object;

    const/4 v8, 0x0

    invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v9

    aput-object v9, v7, v8

    invoke-virtual {v4, v5, v6, v7}, Lcom/burstly/lib/util/LoggerExt;->logInfo(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 104
    div-int/lit8 v2, v3, 0x2

    .line 105
    .local v2, middle:I
    :cond_0
    :goto_0
    iget-object v4, p0, Lcom/burstly/lib/component/networkcomponent/burstly/video/VideoTracker$1;->this$0:Lcom/burstly/lib/component/networkcomponent/burstly/video/VideoTracker;

    iget-boolean v4, v4, Lcom/burstly/lib/component/networkcomponent/burstly/video/VideoTracker;->mCancelled:Z

    if-nez v4, :cond_1

    .line 106
    iget-object v4, p0, Lcom/burstly/lib/component/networkcomponent/burstly/video/VideoTracker$1;->this$0:Lcom/burstly/lib/component/networkcomponent/burstly/video/VideoTracker;

    iget-boolean v4, v4, Lcom/burstly/lib/component/networkcomponent/burstly/video/VideoTracker;->mPaused:Z

    if-nez v4, :cond_0

    if-ge v0, v3, :cond_0

    .line 107
    iget-object v4, p0, Lcom/burstly/lib/component/networkcomponent/burstly/video/VideoTracker$1;->this$0:Lcom/burstly/lib/component/networkcomponent/burstly/video/VideoTracker;

    iget-object v4, v4, Lcom/burstly/lib/component/networkcomponent/burstly/video/VideoTracker;->mPlayer:Landroid/widget/VideoView;

    invoke-virtual {v4}, Landroid/widget/VideoView;->getCurrentPosition()I

    move-result v0

    .line 108
    if-lt v0, v2, :cond_2

    if-ge v0, v3, :cond_2

    .line 109
    invoke-static {}, Lcom/burstly/lib/component/networkcomponent/burstly/video/VideoTracker;->access$000()Lcom/burstly/lib/util/LoggerExt;

    move-result-object v4

    const-string v5, "VideoTracker"

    const-string v6, "Sending track video middle request..."

    const/4 v7, 0x0

    new-array v7, v7, [Ljava/lang/Object;

    invoke-virtual {v4, v5, v6, v7}, Lcom/burstly/lib/util/LoggerExt;->logInfo(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 110
    iget-object v4, p0, Lcom/burstly/lib/component/networkcomponent/burstly/video/VideoTracker$1;->this$0:Lcom/burstly/lib/component/networkcomponent/burstly/video/VideoTracker;

    iget-object v4, v4, Lcom/burstly/lib/component/networkcomponent/burstly/video/VideoTracker;->mMiddleTrackUrl:[Ljava/lang/String;

    const-string v5, "VideoTracker TrackMiddle"

    invoke-direct {p0, v4, v5}, Lcom/burstly/lib/component/networkcomponent/burstly/video/VideoTracker$1;->sendRequest([Ljava/lang/String;Ljava/lang/String;)V

    .line 111
    iget-object v4, p0, Lcom/burstly/lib/component/networkcomponent/burstly/video/VideoTracker$1;->this$0:Lcom/burstly/lib/component/networkcomponent/burstly/video/VideoTracker;

    invoke-virtual {v4}, Lcom/burstly/lib/component/networkcomponent/burstly/video/VideoTracker;->cancel()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 118
    .end local v0           #currentPosition:I
    .end local v2           #middle:I
    .end local v3           #total:I
    :catch_0
    move-exception v1

    .line 119
    .local v1, exception:Ljava/lang/Exception;
    invoke-static {}, Lcom/burstly/lib/component/networkcomponent/burstly/video/VideoTracker;->access$000()Lcom/burstly/lib/util/LoggerExt;

    move-result-object v4

    const-string v5, "VideoTracker"

    invoke-virtual {v4, v5, v1}, Lcom/burstly/lib/util/LoggerExt;->logThrowable(Ljava/lang/String;Ljava/lang/Throwable;)V

    .line 121
    .end local v1           #exception:Ljava/lang/Exception;
    :cond_1
    return-void

    .line 113
    .restart local v0       #currentPosition:I
    .restart local v2       #middle:I
    .restart local v3       #total:I
    :cond_2
    const/16 v4, 0x3e8

    :try_start_1
    invoke-static {v4}, Lcom/burstly/lib/component/networkcomponent/burstly/video/VideoTracker;->sleep(I)V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    goto :goto_0
.end method
